#include "AppConfig.h"
#include <osgEarth/Config>
#include <osgEarth/StringUtils>
#include <osgDB/fstream>


AppConfig::AppConfig()
{
    osgEarth::Config doc;
    std::ifstream in("../user_data/config/sys.xml");

    if (!doc.fromXML(in)) {
        return;
    }
    const osgEarth::Config* cfg = doc.child_ptr("config");
    if (!cfg) return;

    const osgEarth::Config* cit = 0;

    cit = cfg->child_ptr("server");
    if (cit) {
        this->SERVER_PATH = QString::fromStdString(cit->value());
    }
}


AppConfig::~AppConfig()
{
}

AppConfig * AppConfig::instance()
{
    static AppConfig app;
    return &app;
}
